Skip to content

Comments

fix: update proto converters in v1#218

Merged
yarolegovich merged 6 commits intospec-v1/type-updatefrom
serob/update-proto-converters
Feb 18, 2026
Merged

fix: update proto converters in v1#218
yarolegovich merged 6 commits intospec-v1/type-updatefrom
serob/update-proto-converters

Conversation

@nahapetyan-serob
Copy link
Collaborator

Modified from_proto.go and to_proto.go to handle the new proto types.
Updated existing tests to reflect the converter changes.
Deleted id_codec.go and its associated tests, as manual ID decoding from path parameters is no longer required.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nahapetyan-serob, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the protocol buffer conversion layer, updating existing converters and introducing new ones to support an evolved set of proto types. The changes aim to enhance the flexibility and robustness of data serialization and deserialization, particularly for messages, tasks, and agent capabilities. A notable simplification is the removal of manual ID decoding, which streamlines the overall architecture.

Highlights

  • Proto Converter Refactoring: The core proto conversion logic in from_proto.go and to_proto.go has been extensively refactored to align with new proto types and improve data handling. This includes updates to message, part, task, and agent card conversions.
  • New Proto Types and Structures: The a2a.Part and a2a.Message structures were updated to support more flexible content types, including raw bytes and URLs. New proto converters were introduced for CancelTaskRequest, SubscribeToTaskRequest, ListTaskPushConfigRequest, and GetExtendedAgentCardRequest.
  • Simplified ID Handling: The id_codec.go file and its associated tests have been removed. Manual ID decoding from path parameters is no longer required, streamlining ID extraction logic.
  • Enhanced Validation and Error Handling: Numerous proto conversion functions now include explicit validation checks for required fields and improved error messaging, making the conversion process more robust.
  • Agent Card Structure Updates: The AgentCard structure in a2a/agent.go and its corresponding proto conversions were updated. This includes renaming SecurityRequirements to SecurityRequirement, changing Scheme to Schemes, and removing SupportsAuthenticatedExtendedCard.
Changelog
  • a2a/agent.go
    • Renamed SecurityRequirements to SecurityRequirement in comments and struct definition.
    • Changed Scheme field to Schemes in SecurityRequirement struct.
    • Removed SupportsAuthenticatedExtendedCard field from AgentCard struct.
    • Updated comment for SecurityRequirements field in AgentCard struct.
  • a2apb/v1/pbconv/from_proto.go
    • Refactored FromProtoSendMessageRequest to handle new a2a.SendMessageRequest type, including tenant and message validation.
    • Updated FromProtoMessage to include validation for message ID and role, and changed part handling to contentParts.
    • Removed fromProtoFilePart function.
    • Refactored fromProtoPart to support a2a.Part with a Content interface, handling text, raw, data, and URL types.
    • Introduced fromProtoAuthenticationInfo for converting authentication details.
    • Updated fromProtoPushConfig and fromProtoSendMessageConfig to reflect new authentication and history length handling.
    • Refactored FromProtoGetTaskRequest to use direct ID access and added tenant field.
    • Added new conversion functions: FromProtoCancelTaskRequest, FromProtoSubscribeToTaskRequest, and FromProtoGetExtendedAgentCardRequest.
    • Updated FromProtoListTasksRequest to use StatusTimestampAfter and handle history length as a pointer.
    • Modified FromProtoSendMessageResponse and FromProtoStreamResponse to use Message payload field instead of Msg.
    • Updated fromProtoTaskState to use TASK_STATE_CANCELED.
    • Enhanced validation and error handling across multiple conversion functions for agent cards, skills, and security schemes.
  • a2apb/v1/pbconv/from_proto_test.go
    • Updated TestFromProto_fromProtoPart to align with the new a2a.Part structure and content types.
    • Adjusted TestFromProto_fromProtoSendMessageConfig and TestFromProto_fromProtoSendMessageRequest for updated message and configuration types.
    • Modified TestFromProto_fromProtoGetTaskRequest, TestFromProto_fromProtoListTasksRequest, TestFromProto_fromProtoListTasksResponse, TestFromProto_fromProtoCreateTaskPushConfigRequest, TestFromProto_fromProtoGetTaskPushConfigRequest, and TestFromProto_fromProtoDeleteTaskPushConfigRequest to reflect changes in request/response structures and ID handling.
    • Removed tests related to path-based ID extraction.
  • a2apb/v1/pbconv/id_codec.go
    • Removed file, as manual ID decoding from path parameters is no longer required.
  • a2apb/v1/pbconv/id_codec_test.go
    • Removed file, as manual ID decoding from path parameters is no longer required.
  • a2apb/v1/pbconv/to_proto.go
    • Added google.golang.org/protobuf/proto import for pointer handling.
    • Refactored ToProtoSendMessageRequest to handle new a2a.SendMessageRequest type and tenant field.
    • Introduced toProtoAuthenticationInfo for converting authentication details.
    • Updated toProtoPushConfig and toProtoSendMessageConfig to use new authentication and history length handling.
    • Refactored ToProtoGetTaskRequest, ToProtoCancelTaskRequest, ToProtoSubscribeToTaskRequest, ToProtoCreateTaskPushConfigRequest, ToProtoGetTaskPushConfigRequest, and ToProtoDeleteTaskPushConfigRequest to use direct ID access and tenant fields.
    • Modified ToProtoSendMessageResponse and ToProtoStreamResponse to use Message payload field instead of Msg.
    • Refactored toProtoPart to handle a2a.Part with a Content interface, and toProtoDataPart for direct data conversion.
    • Updated toProtoTaskState to use TASK_STATE_CANCELED.
    • Modified toProtoTaskStatus to use Message field instead of Update.
    • Updated ToProtoListTasksRequest to use StatusTimestampAfter and handle optional fields with proto.Int32 and proto.Bool.
    • Refactored ToProtoListTaskPushConfigResponse and ToProtoListTaskPushConfigRequest for new response and request structures.
    • Updated toProtoSupportedInterfaces and ToProtoAgentCard to reflect changes in agent card structure, including security requirements and capabilities.
  • a2apb/v1/pbconv/to_proto_test.go
    • Updated TestToProto_toProtoMessage and TestToProto_toProtoPart to align with the new a2a.Part structure and content types.
    • Adjusted TestToProto_toProtoTaskState for TASK_STATE_CANCELED.
    • Modified TestToProto_toProtoTaskStatus to use the Message field.
    • Updated TestToProto_toProtoTaskPushConfig and TestToProto_toProtoListTaskPushConfigResponse for new push config structures and authentication schemes.
    • Refactored TestToProto_toProtoAgentCard to match the updated AgentCard structure and optional fields.
    • Updated TestToProto_toProtoOAuthFlows and TestToProto_toProtoSecurityScheme for new OAuth flow handling and security scheme definitions.
    • Modified TestToProto_toProtoSendMessageResponse and TestToProto_toProtoStreamResponse for Message payload field changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the proto converters in v1, modifying from_proto.go and to_proto.go to handle new proto types and updating tests to reflect these changes. A significant improvement is the deletion of id_codec.go, removing manual ID decoding from path parameters. The changes introduce more robust validation across the conversion functions, which is a great enhancement. I've identified one high-severity issue in to_proto.go concerning the handling of OAuth flows. Overall, the changes are a solid improvement to the codebase.

@yarolegovich yarolegovich merged commit 0169c55 into spec-v1/type-update Feb 18, 2026
2 checks passed
@yarolegovich yarolegovich deleted the serob/update-proto-converters branch February 18, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants